package com.example.shopspring.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.shopspring.entity.StaSecond;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
public interface StaSecondMapper extends BaseMapper<StaSecond> {

    @Select("SELECT DATE( record_time ) AS record_time,SUM( record_value ) AS record_value FROM sta_second " +
            "WHERE record_time >=#{startDate} GROUP BY DATE( record_time ) ORDER BY record_time")
    List<StaSecond> getSalesRecordByDay(Date startDate);

    List<StaSecond> getSalesRecordsByDay(Date startDate);
}
